class CreateCars < ActiveRecord::Migration
  def change
    create_table :cars do |t|
      t.references :customer, index: true
      t.string :id_card_no
      t.string :license_plate_no
      t.string :body_no
      t.string :engine_no
      t.datetime :registered_at
      t.string :last_insurance_company

      t.timestamps null: false
    end
    add_foreign_key :cars, :customers
  end
end
